IERC1155
Required interface of an ERC1155 compliant contract, as defined in the https://eips.ethereum.org/EIPS/eip-1155[EIP].
Available since v3.1.
Functions
mint
No description
Diamond mint
Declaration
function mint(
) external
Modifiers:
No modifiers
balanceOf
No description
Returns the amount of tokens of token type
id
owned byaccount
.
Requirements:
account
cannot be the zero address.
Declaration
function balanceOf(
) external returns (uint256)
Modifiers:
No modifiers
balanceOfBatch
No description
xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
Requirements:
accounts
andids
must have the same length.
Declaration
function balanceOfBatch(
) external returns (uint256[])
Modifiers:
No modifiers
setApprovalForAll
No description
Grants or revokes permission to
operator
to transfer the caller's tokens, according toapproved
,
Emits an {ApprovalForAll} event.
Requirements:
operator
cannot be the caller.
Declaration
function setApprovalForAll(
) external
Modifiers:
No modifiers
isApprovedForAll
No description
Returns true if
operator
is approved to transferaccount
's tokens.
See {setApprovalForAll}.
Declaration
function isApprovedForAll(
) external returns (bool)
Modifiers:
No modifiers
safeTransferFrom
No description
Transfers
amount
tokens of token typeid
fromfrom
toto
.
Emits a {TransferSingle} event.
Requirements:
to
cannot be the zero address.- If the caller is not
from
, it must be have been approved to spendfrom
's tokens via {setApprovalForAll}. from
must have a balance of tokens of typeid
of at leastamount
.- If
to
refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value.
Declaration
function safeTransferFrom(
) external
Modifiers:
No modifiers
safeBatchTransferFrom
No description
xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
Emits a {TransferBatch} event.
Requirements:
ids
andamounts
must have the same length.- If
to
refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.
Declaration
function safeBatchTransferFrom(
) external
Modifiers:
No modifiers
Events
TransferSingle
No description
Emitted when
value
tokens of token typeid
are transferred fromfrom
toto
byoperator
.
TransferBatch
No description
Equivalent to multiple {TransferSingle} events, where
operator
,from
andto
are the same for all transfers.
ApprovalForAll
No description
Emitted when
account
grants or revokes permission tooperator
to transfer their tokens, according toapproved
.
URI
No description
Emitted when the URI for token type
id
changes tovalue
, if it is a non-programmatic URI.
If an {URI} event was emitted for id
, the standard
https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that value
will equal the value
returned by {IERC1155MetadataURI-uri}.